<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var month = prompt('请输入一个月份') - 0
        switch (month) {
            case 11:
            case 9:
            case 6:
            case 4:
                alert('这个月有30天')
                break
            case 12:
            case 10:
            case 8:
            case 7:
            case 5:
            case 3:
            case 1:
                alert('这个月有31天')
                break
            case 2:
                alert('这个月有28天')
        }
    </script>
</body>

</html>